package com.itheima.servlet;

import com.itheima.dao.DIConstructor3;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DiConstructor {

    /**
     * 依赖注入-构造函数注入
     * set 方法注入
     * @param args
     */
    public static void main(String[] args) {

        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("bean_annotation.xml");
//        DIConstructor2 userDaoImpl2 = classPathXmlApplicationContext.getBean("DIConstructor2", DIConstructor2.class);
//        System.out.println(userDaoImpl2);
//
//        DIConstructor userDaoImpl1 = classPathXmlApplicationContext.getBean("DIConstructor", DIConstructor.class);
//        System.out.println(userDaoImpl1);

        DIConstructor3 userDaoImpl3 = classPathXmlApplicationContext.getBean("DIConstructor3", DIConstructor3.class);
        System.out.println(userDaoImpl3);
    }
}
